﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <link href="../CSS/style1.css" rel="stylesheet" type="text/css" />
    <link href="../CSS/style4.css" rel="stylesheet" type="text/css" />
    <script src="../Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.showModalDialog.js" type="text/javascript"></script>
    <script type="text/javascript">
        //成功添加成功角色
        function role() {
            RoleName=$("#txtName").val();
            //发起更新请求
            $.ajax({
                url: "roleManager.asmx/AddRole",
                type: "post",
                data: JSON.stringify({ RoleName: RoleName }),
                dataType: "json",
                contentType: "application/json",
                success: function (obj) {
                    alert(obj.d ? "角色添加成功" : "角色添加失败");
                    //刷新
                    window.returnValue = true;
                    window.close();
                }, error: function (xmlhttp) {
                    alert("错误：" + xmlhttp.responseText);
                }
            });

        };


    </script>
</head>
<body>
    <table class="tableEdit">
        <thead class="headDiv">
            <tr>
                <td>扮演角色添加</td>
            </tr>
        </thead>
        <tr>
            <th>角色名称：</th>
            <td><input type="text" id="txtName" style="color:blue;width:120px" /></td>
        </tr>
        <tfoot>
            <tr>
                <td colspan="4" style="text-align:center">
                    <input type="button" value="确定" onclick="role();" />&nbsp;&nbsp;
                    <input type="button" value="关闭" onclick="window.close()" />
                </td>
            </tr>
        </tfoot>
    </table>
</body>
</html>
